﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication1.sysAdministrator
{
    public partial class studentDistribution : System.Web.UI.Page
    {
        protected void Submit_Click(object sender, EventArgs e){
            Label3.Text = "";
            if (FileUpload1.HasFile){
                HttpPostedFile file = FileUpload1.PostedFile;
                if (file.ContentLength >= 4194304){
                    Label3.Text = Label3.Text + "请不要上传超过4MB大小的文件";
                }else{
                    string savePath = Server.MapPath("~/upload/");
                    if (!System.IO.Directory.Exists(savePath))
                    {
                        System.IO.Directory.CreateDirectory(savePath);
                    }
                    savePath = savePath + "//" + FileUpload1.FileName;
                    FileUpload1.SaveAs(savePath);
                    string returnText = test.StuInfoInput.upload(savePath);
                    Label3.Text = Label3.Text + returnText;
                }
            }else {
                Label3.Text = Label3.Text + "请上传文件";
            }
        }
    }
}